package com.dataexa.ky.service.mxgraph.bo;

import java.util.ArrayList;
import java.util.List;

// 表示整个 mxGraph 图表
public class MxGraph {
    private FontFamily fontFamily;
    private FontSize fontSize;
    private ShadowColor shadowColor;
    private ShadowAlpha shadowAlpha;
    private ShadowOffset shadowOffset;
    private Translate translate;
    private Scale scale;
    private List<MxElement> elements = new ArrayList<>();

    // Getters and Setters
    public FontFamily getFontFamily() { return fontFamily; }
    public void setFontFamily(FontFamily fontFamily) { this.fontFamily = fontFamily; }
    public FontSize getFontSize() { return fontSize; }
    public void setFontSize(FontSize fontSize) { this.fontSize = fontSize; }
    public ShadowColor getShadowColor() { return shadowColor; }
    public void setShadowColor(ShadowColor shadowColor) { this.shadowColor = shadowColor; }
    public ShadowAlpha getShadowAlpha() { return shadowAlpha; }
    public void setShadowAlpha(ShadowAlpha shadowAlpha) { this.shadowAlpha = shadowAlpha; }
    public ShadowOffset getShadowOffset() { return shadowOffset; }
    public void setShadowOffset(ShadowOffset shadowOffset) { this.shadowOffset = shadowOffset; }
    public Translate getTranslate() { return translate; }
    public void setTranslate(Translate translate) { this.translate = translate; }
    public Scale getScale() { return scale; }
    public void setScale(Scale scale) { this.scale = scale; }
    public List<MxElement> getElements() { return elements; }
    public void setElements(List<MxElement> elements) { this.elements = elements; }

    // 全局设置类
    public static class FontFamily {
        private String family;
        public String getFamily() { return family; }
        public void setFamily(String family) { this.family = family; }
    }


    public static class FontSize {
        private double size;
        public double getSize() { return size; }
        public void setSize(double size) { this.size = size; }
    }

    public static class ShadowColor {
        private String color;
        public String getColor() { return color; }
        public void setColor(String color) { this.color = color; }
    }

    public static class ShadowAlpha {
        private double alpha;
        public double getAlpha() { return alpha; }
        public void setAlpha(double alpha) { this.alpha = alpha; }
    }

    public static class ShadowOffset {
        private double dx;
        private double dy;
        public double getDx() { return dx; }
        public void setDx(double dx) { this.dx = dx; }
        public double getDy() { return dy; }
        public void setDy(double dy) { this.dy = dy; }
    }

    public static class Translate {
        private double dx;
        private double dy;
        public double getDx() { return dx; }
        public void setDx(double dx) { this.dx = dx; }
        public double getDy() { return dy; }
        public void setDy(double dy) { this.dy = dy; }
    }

    public static class Scale {
        private double scale;
        public double getScale() { return scale; }
        public void setScale(double scale) { this.scale = scale; }
    }

    // 图表元素接口
    public interface MxElement {}

    // 绘图操作
    public static class Save implements MxElement {}
    public static class Restore implements MxElement {}
    public static class Begin implements MxElement {}

    public static class Move implements MxElement {
        private double x;
        private double y;
        public double getX() { return x; }
        public void setX(double x) { this.x = x; }
        public double getY() { return y; }
        public void setY(double y) { this.y = y; }
    }

    public static class Line implements MxElement {
        private double x;
        private double y;
        public double getX() { return x; }
        public void setX(double x) { this.x = x; }
        public double getY() { return y; }
        public void setY(double y) { this.y = y; }
    }

    public static class Stroke implements MxElement {}
    public static class FillStroke implements MxElement {}
    public static class Close implements MxElement {}

    public static class StrokeColor {
        private String color;
        public String getColor() { return color; }
        public void setColor(String color) { this.color = color; }
    }

    public static class FillColor {
        private String color;
        public String getColor() { return color; }
        public void setColor(String color) { this.color = color; }
    }

    // 图形元素
    public static class Rect implements MxElement {
        private double x;
        private double y;
        private double w;
        private double h;
        public double getX() { return x; }
        public void setX(double x) { this.x = x; }
        public double getY() { return y; }
        public void setY(double y) { this.y = y; }
        public double getW() { return w; }
        public void setW(double w) { this.w = w; }
        public double getH() { return h; }
        public void setH(double h) { this.h = h; }
    }

    public static class RoundRect extends Rect {
        private double dx;
        private double dy;
        public double getDx() { return dx; }
        public void setDx(double dx) { this.dx = dx; }
        public double getDy() { return dy; }
        public void setDy(double dy) { this.dy = dy; }
    }

    public static class Ellipse implements MxElement {
        private double x;
        private double y;
        private double w;
        private double h;
        public double getX() { return x; }
        public void setX(double x) { this.x = x; }
        public double getY() { return y; }
        public void setY(double y) { this.y = y; }
        public double getW() { return w; }
        public void setW(double w) { this.w = w; }
        public double getH() { return h; }
        public void setH(double h) { this.h = h; }
    }

    // 文本元素
    public static class Text implements MxElement {
        private double x;
        private double y;
        private double w;
        private double h;
        private String str;
        private String align;
        private String valign;
        private int wrap;
        private String format;
        private String overflow;
        private int clip;
        private double rotation;
        public double getX() { return x; }
        public void setX(double x) { this.x = x; }
        public double getY() { return y; }
        public void setY(double y) { this.y = y; }
        public double getW() { return w; }
        public void setW(double w) { this.w = w; }
        public double getH() { return h; }
        public void setH(double h) { this.h = h; }
        public String getStr() { return str; }
        public void setStr(String str) { this.str = str; }
        public String getAlign() { return align; }
        public void setAlign(String align) { this.align = align; }
        public String getValign() { return valign; }
        public void setValign(String valign) { this.valign = valign; }
        public int getWrap() { return wrap; }
        public void setWrap(int wrap) { this.wrap = wrap; }
        public String getFormat() { return format; }
        public void setFormat(String format) { this.format = format; }
        public String getOverflow() { return overflow; }
        public void setOverflow(String overflow) { this.overflow = overflow; }
        public int getClip() { return clip; }
        public void setClip(int clip) { this.clip = clip; }
        public double getRotation() { return rotation; }
        public void setRotation(double rotation) { this.rotation = rotation; }
    }
}